<script type="text/javascript">
$(function () {
	var pg = App.sequence.segmentIndex.ui, pp = pg.params,
		naviName = pg.children('.navi').seek('title');
	naviName.text(pp.name+'序列号段');
	var gd = pg.find('.grid').mac('grid', {
		key: 'id',
		cols: [{
			field: 'beginNo', title : '起始值', width: 120
		},{
			field: 'endNo', title : '结束值', width: 120
		},{
			field: 'currentNo', title : '当前值', width: 120
		},{
			field: 'node', title : '节点', width: 120
		},{
			field: 'id', title : '操作', width: 120,
			render: function(r, tr, gd) {
				var p = $('<div></div>'), v = r.status,
					st = '<span class="a"></span>';
				p.append('&nbsp;');
				$(st).click(function(){
					if (App.logon.power('sequence.segment.update')){
						/* App.open({
							title: '修改号段',
							ctx : 'sequence',
							action : 'segmentEdit',
							params : Object.assign({title:pp.name},r)
						}, $.noop, pg.parent()); */
						App.open({
							ctx: 'sequence',
							action: 'segmentEdit',
							title: '号段修改',
							model: true,
							noCloser: true,
							params:r
						},function() {
							gd.load()
						});
					}
				}).append('修改').appendTo(p);
				return p;
			}
		}

	],
		loader: {
			url: App.ctx + '/segment/list.do',
			params: {
				pageNo: 1, pageSize: 20 ,sequenceId:pg.params.id
			},
			autoLoad: true
		},
		pagerLength: 20
	});

	pg.seek('back').click(function(){
		App.show({
			title: '序列管理',
			ctx: 'sequence',
			action: 'infoIndex',
			params: {}
		}, $.noop, pg.parent());
	});
	function adjust(){
		var h = pg.parent().height();
		pg.height(h);
		gd.parent().height(h - 68);
		gd.adjust();
	}
	$(window).resize(adjust);
	adjust();
});
</script>
<div class="navi">
	<span class="a" name="back">序列管理</span>&gt;&gt;
	<span name="title">Xxx序列号段</span>
</div>
<div class="head">
   <!-- <button name="addSequence" class="">添加号段</button>-->
   <!-- <input type="text" name="key" class="fr" placeholder="查找" />-->
</div>
<div class="body">
	<div class="grid"></div>
</div>